/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package extension.game.poker;

import com.smartfoxserver.v2.entities.User;
import log.Debug;

/**
 *
 * @author daz
 */
public class PokerPlayer {

    public static final int WAITING = 0;
    public static final int PLAYING = 1;
    public static final int SIT_OUT = 2;
    private int bettingChoice;
    private long money;
    private long bet;
    private String name;
    private User user;
    public int card1;
    public int card2;
    private int handStrength;
    public int[] cardArr;
    private int state;
    public int handRank;
    private int seatPos;
    private long addMoney;
    private long totalMoney;

    public PokerPlayer() {
    }

    public void setName(String name) {
        this.name = name;
    }

    public PokerPlayer(long moneyJoin, User user, long totalMoney) {
        this.money = moneyJoin;
        this.user = user;
        this.name = user.getName();
        this.bettingChoice = -1;
        this.totalMoney = totalMoney;
        Debug.d(name + ": total money " + totalMoney);
    }

    public void setState(int state) {
        this.state = state;
    }

    public int getState() {
        return state;
    }

    public String getName() {
        return name;
    }

    public long getBet() {
        return bet;
    }

    public long getMoney() {
        return money;
    }

    public void setBet(long bet) {
        this.bet = bet;
        this.money -= bet;
    }

    public void winMoney(long winMoney) {
        this.money += winMoney;
        this.addMoney = 0;
    }

    public void betMore(long moneyMore) {
        this.bet += moneyMore;
        this.money -= moneyMore;

    }

    public void setUser(User user) {
        this.user = user;
    }

    public User getUser() {
        return user;
    }

    public void setBettingChoice(int bettingChoice) {
        this.bettingChoice = bettingChoice;
    }

    public int getBettingChoice() {
        return bettingChoice;
    }

    public void setHandStrength(int handStrength) {
        this.handStrength = handStrength;
    }

    public int getHandStrength() {
        return handStrength;
    }

    public void setSeatPos(int seatPos) {
        this.seatPos = seatPos;
    }

    public int getSeatPos() {
        return seatPos;
    }

    public long getAddMoney() {
        return addMoney;
    }

    public void updateAddMoney(long delta) {
        this.addMoney += delta;
    }

    public void setTotalMoney(long totalMoney) {
        this.totalMoney = totalMoney;
    }

    public long getTotalMoney() {
        return totalMoney;
    }
}
